package chapter17.h17_2;

import chapter17.h17_1.NumberGenerator;

public class NumberObserver implements Observer {
    public void update(NumberGenerator generator){
        int number = generator.getNumber();
        for(int i = 0; i < number; i ++){
            System.out.println( (i + 1) + " ");
        }
        try{
            Thread.sleep(100);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
